package org.blame.rabbitmqspringboot.listener;


import com.rabbitmq.client.Channel;
import org.blame.rabbitmqspringboot.constants.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {


    @RabbitListener(queues = Constants.WORK_QUEUE123)
    public void queueListener1(Message message ,Channel channel){
        System.out.println("监听的队列"+Constants.WORK_QUEUE123+"收到的消息"+message+"channel"+channel);
    }

    @RabbitListener(queues = Constants.WORK_QUEUE123)
    public void queueListener2(String message){
        System.out.println("监听的队列"+Constants.WORK_QUEUE123+"收到的消息"+message);
    }


}
